import request from "@/request";

export async function answerQuestionUsingPost(body) {
    return request({
        method: 'POST',
        url: '/api/question/answer',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body
    })
}

export async function getQuestionByBankId(bankId){
    return request({
        method: 'POST',
        url: '/api/question/get/bankId',
        params: {
            bankId: bankId
        }
    })
}

export async function getQuestionByBankIdAndTypeUsingPost(bankId , type){
    return request({
        method: 'POST',
        url: '/api/question/get/bankId/type',
        params: {
            bankId: bankId,
            type: type
        }
    })
}

export async function adminQuestionUsingPost(body){
    return request({
        method: 'POST',
        url: '/api/question/admin',
        data: body
    })
}

export async function addQuestionUsingPost(body){
    return request({
        method: 'POST',
        url: '/api/question/add',
        data: body
    })
}

export async function getQuestionVOByIdUsingGet(id){
    return request({
        method: 'GET',
        url: '/api/question/get/vo',
        params:{
            id: id
        }
    })
}

export async function deleteQuestionUsingPost(body){
    return request({
        method: 'POST',
        url: '/api/question/delete',
        data: body
    })
}